<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<h:body>
	<h1>Decide Dates</h1>
	
	<h:form>
				<p:panel header="Election Details Form">
					<h:panelGrid columns="2" id="regGrid">
						<h:outputLabel for="name">Election Name:</h:outputLabel>
						<p:inputText id="name" value="#{electionFormBean.name}" />
  	 				<h:outputLabel for="candidacy_start_date">Candidacy Start Date: </h:outputLabel>
						<p:calendar id="candidacy_start_date" required = "true" value="#{electionFormBean.candidacystartdate}" />
						<h:outputLabel for="candidacyenddate">Candidacy End Date: </h:outputLabel>
						<p:calendar id="candidacyenddate" value="#{electionFormBean.candidacyenddate}" />
						<h:outputLabel for="electionstartdate">Election Start Date: </h:outputLabel>
						<p:calendar id="electionstartdate" value="#{electionFormBean.electionstartdate}" />
						<h:outputLabel for="electionenddate">Election End Date: </h:outputLabel>
						<p:calendar id="electionenddate" value="#{electionFormBean.electionenddate}" /> 
					</h:panelGrid>
				<p:commandButton value="Submit" update="regGrid"
				action="#{electionFormBean.submitElection()}" />

				</p:panel>
		</h:form>
</h:body>
</html>